package com.thinkgem.jeesite.common.utils;

/**
 * Created by admin on 2017-12-5.
 */
public class TicketUtils {

    public static String generate(String userId) {
        if (userId == null) {
            throw new RuntimeException("generate exception error,userId is null");
        }

        String ticket = userId + "" + System.currentTimeMillis();
        if (StringUtils.isBlank(ticket)) {
            throw new RuntimeException("generate exception error");
        }
        return TicketConfig.PREFIX.concat("-").concat(EncryptUtils.getMD5(ticket)).concat(".fox.com");
    }

}
